<%--
  Created by IntelliJ IDEA.
  User: 57998
  Date: 2020/10/22
  Time: 0:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
    pageContext.setAttribute("APP_PATH", request.getContextPath());
%>

<html>
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" class="autoinsert" src="${APP_PATH }/js/jquery-2.2.0.min.js"></script>
    <!-- bootstrap规定使用前置设置 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="${APP_PATH }/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="${APP_PATH }/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <link rel="stylesheet" href="${APP_PATH }/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="${APP_PATH }/css/houtai_updateuserinfo.css" />
    <script type="text/javascript" class="autoinsert" src="${APP_PATH }/js/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="${APP_PATH }/css/layer.css" />
    <title>修改影片信息</title>
</head>
<body>

<%@ include file="houtai_left.jsp"%>
<%@ include file="houtai_top.jsp"%>

<input type="hidden" id="show_left" value="${show_left}" />
<script type="text/javascript">
    $("div[id*='left_y']").hide();
    var now_left = $("#now_left").val();
    $("#" + now_left).show();
    var show_left = $("#show_left").val();
    $("#" + show_left).attr("style", "background: #293038;");
</script>

<div class="main">

    <div class="main_top">
        <h5 class="main_top_text">修改影片信息</h5>
    </div>

    <form action="${pageContext.request.contextPath}/houtai/updatefilms" method="post" name="form_add">
        <div class="main_content">
            <c:forEach var="U" items="${films}">
                <input type="hidden" id="id" name="id" value="${U.id}" />
                <div class="main_name">
                    <div class="main_text">影片名：</div>
                    <input type="text" id="name" name="name" value="${U.name}"/>
                </div>
                <div class="main_name">
                    <div class="main_text">影片简介：</div>
                    <input type="text" id="content" name="content" value="${U.content}"/>
                </div>
                <div class="main_name">
                    <div class="main_text">海报路径：</div>
                    <input type="text" id="img" name="img" value="${U.img}"/>
                </div>
                <div class="main_name">
                    <div class="main_text">视频路径：</div>
                    <input type="text" id="vedio" name="vedio" value="${U.vedio}"/>
                </div>
                <div class="main_name">
                    <div class="main_text">类别：</div>
                    <select id="type" name="type" style="width: 700px;">
                        <option value="喜剧" <c:if test="${'喜剧' eq U.type}">selected</c:if> >喜剧</option>
                        <option value="动作" <c:if test="${'动作' eq U.type}">selected</c:if> >动作</option>
                        <option value="爱情" <c:if test="${'爱情' eq U.type}">selected</c:if> >爱情</option>
                        <option value="惊悚" <c:if test="${'惊悚' eq U.type}">selected</c:if> >惊悚</option>
                        <option value="犯罪" <c:if test="${'犯罪' eq U.type}">selected</c:if> >犯罪</option>
                        <option value="悬疑" <c:if test="${'悬疑' eq U.type}">selected</c:if> >悬疑</option>
                        <option value="战争" <c:if test="${'战争' eq U.type}">selected</c:if> >战争</option>
                        <option value="科幻" <c:if test="${'科幻' eq U.type}">selected</c:if> >科幻</option>
                        <option value="动画" <c:if test="${'动画' eq U.type}">selected</c:if> >动画</option>
                        <option value="恐怖" <c:if test="${'恐怖' eq U.type}">selected</c:if> >恐怖</option>
                        <option value="家庭" <c:if test="${'家庭' eq U.type}">selected</c:if> >家庭</option>
                        <option value="传记" <c:if test="${'传记' eq U.type}">selected</c:if> >传记</option>
                        <option value="冒险" <c:if test="${'冒险' eq U.type}">selected</c:if> >冒险</option>
                        <option value="奇幻" <c:if test="${'奇幻' eq U.type}">selected</c:if> >奇幻</option>
                        <option value="武侠" <c:if test="${'武侠' eq U.type}">selected</c:if> >武侠</option>
                        <option value="历史" <c:if test="${'历史' eq U.type}">selected</c:if> >历史</option>
                        <option value="运动" <c:if test="${'运动' eq U.type}">selected</c:if> >运动</option>
                        <option value="歌舞" <c:if test="${'歌舞' eq U.type}">selected</c:if> >歌舞</option>
                        <option value="音乐" <c:if test="${'音乐' eq U.type}">selected</c:if> >音乐</option>
                        <option value="记录" <c:if test="${'记录' eq U.type}">selected</c:if> >记录</option>
                        <option value="伦理" <c:if test="${'伦理' eq U.type}">selected</c:if> >伦理</option>
                        <option value="西部" <c:if test="${'西部' eq U.type}">selected</c:if> >西部</option>
                        <option value="其他" <c:if test="${'其他' eq U.type}">selected</c:if> >其他</option>
                    </select>
<%--                    <input type="text" id="type" name="type" value="${U.type}" />--%>
                </div>
                <div class="main_name">
                    <div class="main_text">观看限制(0:免费观看，1:会员专享)：</div>
                    <input type="text" id="vip_look" name="vip_look" value="${U.vip_look}" />
                </div>
				<div class="main_name">
				    <div class="main_text">热度(流量)：</div>
				    <input type="text" id="hot" name="hot" value="${U.hot}" />
				</div>
                <div class="main_name">
                    <div class="main_text">上架时间：</div>
                    <input type="text" id="time_temp" name="time_temp" value="${U.time_temp}" />
                </div>
            </c:forEach>
            <button class="main_show_button" onclick="yes_update()"><a href="#" class="main_show_a">确认修改<i class="fa fa-check-square-o" style="padding-left: 5px;"></i></a></button>
        </div>

        <script type="text/javascript">
            function yes_update() {
                if($("#name").val() != "" && $("#content").val() != "" && $("#img").val() != "" && $("#hot").val() != "" && $("#vedio").val() != "" && $("#type").val() != "" && $("#vip_look").val() != "" && $("#time_temp").val() != ""){
                    form_add.submit();
                }else{
                    layer.msg('请将信息完整输入!', {
                        time: 2000
                    });
                }
            }
        </script>

</div>

</body>
</html>
